/***************************************************************
Made by: Cultured::Labs

Copyright (c) 2010 Cultured::Labs
****************************************************************/
#include "whoWins.h"

int whoWins(char option_a, char option_b) {
  switch (option_a) {
  case 'r':
    if (option_b == 's') return 1;
    else if (option_b == 'p') return 2;
    else return 0;
  case 'p':
    if (option_b == 'r') return 1;
    else if (option_b == 's') return 2;
    else return 0;
  case 's':
    if (option_b == 'p') return 1;
    else if (option_b == 'r') return 2;
    else return 0;
  default: return -1;
  }
}
